<template>
  <el-card class="musicList">
    <!-- 查询部分 -->
    <div class="searchForm">
      <el-form :inline="true" :model="searchForm" size="mini">
        <el-form-item label="名称">
          <el-input v-model="searchForm.p" placeholder="请输入" @keyup.enter.native="m_handleFilter"></el-input>
        </el-form-item>
        <el-form-item label="角色">
          <el-input
            v-model="searchForm.type"
            placeholder="请输入"
            @keyup.enter.native="m_handleFilter"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="m_handleFilter">查询</el-button>
          <el-button type="primary" @click="m_handleClear">重置</el-button>
        </el-form-item>
      </el-form>
    </div>

    <div class="hh-btnbox">
      <el-button size="mini" @click="handleAddGoods">新增</el-button>
    </div>
    <!-- 查询部分！！！ -->

    <!-- 列表 -->
    <div class="table-box">
      <el-table
        ref="multipleTable"
        :data="tableData.list"
        highlight-current-row
        style="width: 100%"
        border
        size="mini"
        stripe
        @selection-change="m_handleSelectionChange"
      >
        <el-table-column align="center" width="55" type="selection" fixed="left"></el-table-column>
        <el-table-column align="center" type="index" width="50" label="序号"></el-table-column>
        <el-table-column
          v-for="item in tableData.headList"
          :key="item.name"
          :label="item.title"
          :prop="item.name"
          :show-overflow-tooltip="true"
          align="center"
        >
          <template slot-scope="scope">
            <div v-if="item.name=='images'">
              <img class="hh-tableImg" :src="scope.row.img_url" alt />
            </div>
            <div v-else>{{scope.row[item.name]}}</div>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作" fixed="right">
          <template slot-scope="scope">
            <el-button size="mini" @click="handleEditGoods(scope.row)">编辑</el-button>
            <el-button size="mini" @click="handleDelGoods(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        v-show="tableData.total>0"
        :total="tableData.total"
        :page.sync="searchForm.start"
        :limit.sync="searchForm.count"
        @pagination="m_getTableData"
      />
    </div>
    <!-- 列表 -->
  </el-card>
</template>


<script>
import { axiosBlogList } from "@/api/xcx/blog";
import tablePage from "@/mixins/tablePage";
import pagination from "@/components/Pagination";
export default {
  name: "musicList",
  mixins: [tablePage],
  components: {
    pagination
  },
  data() {
    return {
      dialog: {
        title: "标题",
        dialogVisible: false,
        width: "30%"
      },
      searchForm: {
        //搜索数据
        start: 1,
        count: 10
      },
      fn: axiosBlogList,
      AEform: {},
      tableData: {
        //表格数据
        headList: [
          {
            name: "content",
            title: "内容"
          },
          {
            name: "nickName",
            title: "发布人"
          },
        ],
        list: [],
        total: 0
      },
      rows: {}, //表行
      multipleSelection: []
    };
  },
  computed: {},
  created() {
    this.m_getTableData();
  },
  methods: {
    handleAddGoods() {
      // 新增
      alert('功能暂时没开发')
    },
    handleEditGoods(row) {
      // 修改
      alert('功能暂时没开发')
    },
    handleDelGoods(row) {
      // 删除
      alert('功能暂时没开发')
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss">
.musicList {
}
</style>
